<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type"/>
    <title><?php e($options['siteName']); ?></title>
    <!-- load external stylesheets -->
    <?php e($html->css("core")); ?>
    <?php e($html->css("sme")); ?>
    <?php e($html->css("jquery.ui/jquery.ui")); ?>
    <?php e($html->css("jquery.ui/jquery.tools")); ?>
    <!-- Load IE specific styles -->
    <!--[if IE 6]>
    <?php e($html->css("iefix")); ?>
    <![endif]-->
    <!-- load external javascripts -->
    <?php e($javascript->link("jquery/jquery.core")); ?>
    <?php e($javascript->link("jquery/jquery.tools")); ?>
    <?php e($javascript->link("jquery/jquery.form")); ?>
    <?php e($javascript->link("jquery/jquery.validate")); ?>
    <?php e($javascript->link("jquery/jquery.ui.widget")); ?>
    <?php e($javascript->link("jquery.me")); ?>
    <?php e($scripts_for_layout); ?>
    <?php e($javascript->link("sme")); ?>
</head>
<body>

<div id="wrapper">
<div id="container">

<?php if(!$user['id']): ?>
    <?php e($this->element('form_user_login')); ?>
<?php endif; ?>

<!-- Header section, website name, links, banner -->
<div id="header">
    <h1>
    <?php e($html->link($options['siteName'],
        array('controller' => 'users', 'action' => 'home'),
        array('id'=>'home', 'title'=>__('Website Home Page', true))
    )); ?></h1>
    <div id="info">
        <div id="user">
            <?php e($html->link(__('Help & Documentation', true),
                array('controller' => 'pages', 'action' => 'display', 'help'),
                array('title'=>__('view documentation of how to navigare through the website', true), 'id'=>'help')
            )); ?>
            <?php e($html->link(__('Bugs & Sugguestions', true),
                array('controller' => 'bugs', 'action' => 'index'),
                array('title'=>__('Submit an bug during your use or give sugguestions for us to make improvement', true), 'id'=>'bug')
            )); ?>
            <?php if($user && $user['id']): ?>
                <span><?php printf(__('Welcome, %s, ', true), $user['name']); ?></span>
                <?php e($html->link(__('Logout', true),
                    array('controller' => 'users', 'action' => 'logout'),
                    array('id' => 'logout'))); ?>
            <?php else: ?>
                <span><?php __('You are not logged in yet'); ?></span>
                <?php e($html->link(__('Login', true),
                    array('controller' => 'users', 'action' => 'login'),
                    array('id' => 'login', 'title'=>__('Log into the website as an student or teacher to admin your staff', true)))); ?>
            <?php endif; ?>
        </div>
    </div>
</div>

<!-- Ajax Indicator -->
<span class="notifier"><?php __('Loading, Please wait...'); ?></span>

<!-- Content section, with two columns -->
<!-- Layout differs before and after user loggedin -->
<?php if($user['id']): ?>
    <div id="content">
<?php else: ?>
    <div id="content" style="margin-left: 2%">
<?php endif; ?>

<!-- Sesstion information -->
<?php if($session->check('Message.auth')): ?>
    <span class="authstatus"><?php $session->flash('auth'); ?></span>
<?php endif; ?>
<span class="ajaxstatus"><?php $session->flash(); ?></span>

<!-- After user login -->
<?php if($user['id']): ?>
    <!-- Left column -->
    <div id="menu">
        <?php e($this->element('menu_user_' . $user['group'])); ?>
    </div>
    <!-- Right Column -->
    <div id="main">
        <?php e($content_for_layout); ?>
    </div>
<?php else: ?>
    <!-- Only Right Column when  -->
    <div id="main">
        <?php e($content_for_layout); ?>
    </div>
<?php endif; ?>

<br class="clear"/>
</div><!-- End of content -->

<!-- CSS clear Fix -->
<br class="clear"/>
<br class="clear"/>
<br class="clear"/>
<br class="clear"/>
<!-- Footer Section, copyright information, author statement -->
<div id="footer">
    <p><?php e($options['siteFooter']); ?></p>
</div>

<div id="tooltip" class="tooltip default"></div>
<div id="abstract" class="tooltip default abstract"></div>

</div>
</div>
<!-- End of Page wrapper -->

<div id="dialogs" class="dialogs">
    <?php e($this->element("dialog_data_delete")); ?>
</div>

</body>
</html>